-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Keycloak Authorization configuration #2432
Conversation
* @param superUsers Super users list who have all the rights on the cluster | ||
* @param authorization The authorization configuration from the Kafka CR | ||
*/ | ||
private void configureAuthorization(String clusterName, List<String> superUsers, KafkaAuthorization authorization) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we maybe split this into two methods? configureSimpleAuthorization
and configureKeycloakAuthorization
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have a similar pattern for configuring authentication on which I agree. The configuraAuthentication
method is just one and we have the logic for different authentication mechanisms inside. I am not sure about the advantage of having different methods here.
cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaCluster.java
Show resolved
Hide resolved
} else if (KafkaAuthorizationKeycloak.TYPE_KEYCLOAK.equals(authorization.getType())) { | ||
KafkaAuthorizationKeycloak keycloakAuthz = (KafkaAuthorizationKeycloak) authorization; | ||
writer.println("authorizer.class.name=" + KafkaAuthorizationKeycloak.AUTHORIZER_CLASS_NAME); | ||
writer.println("principal.builder.class=" + KafkaAuthorizationKeycloak.PRINCIPAL_BUILDER_CLASS_NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you double check what impact does this have on the internal super users? Do they still keey their own names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should keep their names, yes.
The JwtKafkaPrincipalBuilder only does something different when user was authenticated over SASL_OAUTHBEARER as seen here. An internal user would be handled by the same logic as before.
b6c93cd
to
524883a
Compare
This is not WIP anymore but we don't have to merge until strimzi/strimzi-kafka-oauth#24 is merged. Anyway can you have another review pass @scholzj @mstruk please? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits only. LGTM.
api/src/main/java/io/strimzi/api/kafka/model/KafkaAuthorizationKeycloak.java
Show resolved
Hide resolved
cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java
Outdated
Show resolved
Hide resolved
@tombentley @scholzj @mstruk FYI I tried this with the keycloak library 0.3.0 (from the staging repository) and the integration seems to work fine. |
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Fixed a minor bug Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno <[email protected]>
b8ffb4b
to
bca7039
Compare
Signed-off-by: Paolo Patierno <[email protected]>
@strimzi-ci run tests |
❗ Build Failed ❗ |
@strimzi-ci run tests |
❌ Test Summary ❌TEST_PROFILE: acceptance ❗ Test Failures ❗
Re-run command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but LGTM otherwise.
Signed-off-by: Paolo Patierno <[email protected]>
Signed-off-by: Paolo Patierno [email protected]
Type of change
Description
This PR fixes #2428.
It's still missing tests and including the
kafka-oauth-keycloak-authorizer
JAR coming from this other PR strimzi/strimzi-kafka-oauth#24 still in progress.Checklist
Please go through this checklist and make sure all applicable tasks have been done
./design